package com.nuc.bigdata.configer;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.nuc.bigdata.exception.BusinessException;
import com.nuc.bigdata.util.FeignClientErrorDecoderCommon;
import feign.Response;
import feign.Util;
import feign.codec.ErrorDecoder;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;
import java.io.Reader;

import static feign.FeignException.errorStatus;

/**
 * @author JackLuo
 * @date 2019/10/31
 */
@Configuration
public class FeignClientErrorDecoder implements ErrorDecoder {

    @Override
    public Exception decode(String methodKey, Response response) {
        return FeignClientErrorDecoderCommon.errorDecoder(methodKey, response);
    }
}
